package com.lclz.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lclz.model.News;
import com.lclz.model.NewsDetail;
import com.lclz.service.NewsService;

@Controller
@RequestMapping(value="/news")
public class NewsController {
	
	@Resource
	private NewsService newsService;

	@RequestMapping(value="/list")
	@ResponseBody
	public List<News> list(String show){
		return newsService.getNewsList(show);
	}
	
	
	@RequestMapping(value="/{id}")
	@ResponseBody
	public NewsDetail detail(@PathVariable("id") int id){
		return newsService.getNewsDetail(id);
	}
}
